<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
<title>Insert title here</title>
</head>
<body>

	<div class="content-wrapper" th:fragment="docUpdate">

		<h3>文档更新</h3>

		<div class="panel panel-default">
			<div class="panel-heading"></div>
			<div class="panel-body">
				<form id="dcoForm" method="post" th:action="@{/docUpdate/upload}" enctype="multipart/form-data"
					class="form-horizontal">
					<input class="form-control" type="hidden" id="returnPage" name="returnPage" th:value="${returnPage}" />

					<fieldset>
						<div class="form-group" style="margin-top: 10px; margin-bottom: 10px;">
							<label for="input-id-1" class="col-sm-1 control-label">文档类型</label>
							<div class="col-sm-4">
								<select name="docType" id="docType" class="form-control m-b">
									<option th:each="docType,status:${docTypeList}" th:value="${docTypeList[__${status.index}__].dictkeyValue}"
										th:text="${docTypeList[__${status.index}__].dictkeyName}"></option>
								</select>
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px; margin-bottom: 10px;">
							<label for="input-id-1" required="" minlength="1" class="col-sm-1 control-label">*文档标题</label>
							<div class="col-sm-4">
								<input type="text" id="docTitle" required="" minlength="1" name='docTitle' class="form-control" />
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px; margin-bottom: 10px;">
							<label for="input-id-1" class="col-sm-1 control-label">作者</label>
							<div class="col-sm-4">
								<input type="text" id="docAuthor" required="" minlength="1" name='docAuthor' th:value="${displayName}"
									class="form-control" />
							</div>
						</div>

						<div class="form-group" style="margin-top: 10px; margin-bottom: 10px;">
							<label for="input-id-1" class="col-sm-1 control-label">*安全组</label>
							<div class="col-sm-4">
								<select name="docGroup" id="docGroup" class="form-control m-b">
									<option th:each="groupObj,group:${groupList}" th:value="${groupList[__${group.index}__].groupId}"
										th:text="${groupList[__${group.index}__].groupName}"></option>
								</select>
							</div>
						</div>
					</fieldset>

					<fieldset>
						<div class="form-group">
							<label class="col-sm-1 control-label">上传文件</label>
							<div class="col-sm-4">
								<label class="radio-inline c-radio"> <input id="uploadMode1" type="radio" name="uploadMode" value="1"
									checked='' /> <span class="fa fa-circle"></span>本地文件
								</label> <label class="radio-inline c-radio"> <input id="uploadMode2" type="radio" name="uploadMode" value="2" />
									<span class="fa fa-circle"></span>服务器文件
								</label> <br />
								<div id="selectFile"></div>
							</div>
						</div>
						<div th:replace="doc/list/serverFileList :: FolderListBtn"></div>


					</fieldset>

					<fieldset>

						<div class="form-group">
							<label for="input-id-1" class="col-sm-1 control-label">简介</label>
							<div class="col-sm-4">
								<textarea class="form-control" id="docSummary" name="docSummary" rows="3"></textarea>
							</div>
						</div>

					</fieldset>


					<fieldset id="docMetadata">


						<div th:each="obj,metaDate:${metaDateList}" style="margin-top: 10px; margin-bottom: 10px;" class="form-group">
							<label for="input-id-1" th:text="${metaDateList[__${metaDate.index}__].metadataName}"
								class="col-sm-1 control-label"></label>
							<div
								th:if="${metaDateList[__${metaDate.index}__].metadataType=='text' and metaDateList[__${metaDate.index}__].importMode=='1'}"
								class="col-sm-4">
								<input type="text" th:id="${metaDateList[__${metaDate.index}__].metadataTag}"
									th:name='${metaDateList[__${metaDate.index}__].metadataTag}' class="form-control" />
							</div>



							<div
								th:if="${metaDateList[__${metaDate.index}__].metadataType=='text' and metaDateList[__${metaDate.index}__].importMode=='2'}"
								class="col-sm-4">
								<select th:id="${metaDateList[__${metaDate.index}__].metadataTag}"
									th:name='${metaDateList[__${metaDate.index}__].metadataTag}' class="form-control selectData">
								</select> <input type="hidden" th:id="|${metaDateList[__${metaDate.index}__].metadataTag}_data|"
									th:name='|${metaDateList[__${metaDate.index}__].metadataTag}_data|'
									th:value='${metaDateList[__${metaDate.index}__].selectData}' />
							</div>

							<div
								th:if="${metaDateList[__${metaDate.index}__].metadataType=='number' and metaDateList[__${metaDate.index}__].importMode=='1'}"
								class="col-sm-4">
								<input type="text" th:id="${metaDateList[__${metaDate.index}__].metadataTag}"
									th:name='${metaDateList[__${metaDate.index}__].metadataTag}' class="form-control" />
							</div>



							<div
								th:if="${metaDateList[__${metaDate.index}__].metadataType=='number' and metaDateList[__${metaDate.index}__].importMode=='2'}"
								class="col-sm-4">
								<select th:id="${metaDateList[__${metaDate.index}__].metadataTag}"
									th:name='${metaDateList[__${metaDate.index}__].metadataTag}' class="form-control selectData">

								</select> <input type="hidden" th:id="|${metaDateList[__${metaDate.index}__].metadataTag}_data|"
									th:name='|${metaDateList[__${metaDate.index}__].metadataTag}_data|'
									th:value='${metaDateList[__${metaDate.index}__].selectData}' />

							</div>

							<div th:if="${metaDateList[__${metaDate.index}__].metadataType=='textarea'}" class="col-sm-4">
								<textarea class="form-control" th:id="${metaDateList[__${metaDate.index}__].metadataTag}"
									th:name='${metaDateList[__${metaDate.index}__].metadataTag}' rows="3"></textarea>
							</div>



							<div th:if="${metaDateList[__${metaDate.index}__].metadataType=='date'}" data-date-format="yyyy-mm-dd hh:ii"
								class="col-sm-4">

								<div class="input-group date dateclass">
									<input type="text" th:id="${metaDateList[__${metaDate.index}__].metadataTag}"
										th:name='${metaDateList[__${metaDate.index}__].metadataTag}' class="form-control" /> <span
										class="input-group-addon"> <span class="fa fa-calendar"></span>
									</span>
								</div>


							</div>

						</div>

					</fieldset>



					<fieldset>
						<div class="form-group ">
							<label for="input-id-1" class="col-sm-1 control-label"></label>
							<div class="col-sm-4 ">
								<button type="button" class="btn btn-primary pull-right" id="submitBtn">保存</button>
								<button type="button" class="btn btn-default pull-right mr-sm" id="returnBtn">返回</button>

							</div>
						</div>
					</fieldset>
					<input type="hidden" id="docName" name="docName" th:value="${docName}" />
				</form>

			</div>
		</div>




	</div>

	<div th:fragment="docUpdate_dialog">
		<div th:replace="doc/list/serverFileList :: serverFileList"></div>
		<div th:replace="doc/list/serverFileList :: serverFolderList"></div>

	</div>
	<div th:fragment="docUpdate_js">

		<script type="text/javascript" th:src="@{/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js}"></script>
		<script th:src="@{/bootstrap-filestyle/src/bootstrap-filestyle.js}"></script>
		<!-- bootstrapTree -->
		<script th:src="@{/business/bootstrapTree/bootstrap-treeview.js}"></script>
		<script th:src="@{/business/doc/list/serverFileList.js}"></script>
		<script th:src="@{/business/doc/docUpdate.js}"></script>


	</div>
	<div th:fragment="docUpdate_css"></div>

</body>
</html>